package cn.cdut.yiwenqian.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * CdutPostNews entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CDUT_POST_NEWS", catalog = "cdutpostbar")
public class CdutPostNews implements java.io.Serializable {

	// Fields

	private Integer unumber;
	private CdutPostUsers cdutPostUsers;
	private String name;
	private Date beginDate;
	private String content;
	private String image;
	private String source;

	// Constructors

	/** default constructor */
	public CdutPostNews() {
	}

	/** minimal constructor */
	public CdutPostNews(Integer unumber) {
		this.unumber = unumber;
	}

	/** full constructor */
	public CdutPostNews(Integer unumber, CdutPostUsers cdutPostUsers,
			String name, Date beginDate, String content, String image,
			String source) {
		this.unumber = unumber;
		this.cdutPostUsers = cdutPostUsers;
		this.name = name;
		this.beginDate = beginDate;
		this.content = content;
		this.image = image;
		this.source = source;
	}

	// Property accessors
	@Id
	@GeneratedValue(generator="newsIdGenerator")
	@GenericGenerator(name="newsIdGenerator",strategy="increment")
	@Column(name = "unumber", unique = true, nullable = false)
	public Integer getUnumber() {
		return this.unumber;
	}

	public void setUnumber(Integer unumber) {
		this.unumber = unumber;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "auther")
	public CdutPostUsers getCdutPostUsers() {
		return this.cdutPostUsers;
	}

	public void setCdutPostUsers(CdutPostUsers cdutPostUsers) {
		this.cdutPostUsers = cdutPostUsers;
	}

	@Column(name = "name", length = 32)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "beginDate", length = 10)
	public Date getBeginDate() {
		return this.beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	@Column(name = "content", length = 128)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "image", length = 128)
	public String getImage() {
		return this.image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	@Column(name = "source", length = 128)
	public String getSource() {
		return this.source;
	}

	public void setSource(String source) {
		this.source = source;
	}

}